﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CourseDetail.ascx.cs" Inherits="AGR.Web.Controls.Form.DetailForm.CourseDetail" %>
<link href="../../../Content/CSS/Controls.css" rel="stylesheet" type="text/css" />

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<%@ Register TagPrefix="uc" TagName="Message" Src="~/Controls/Message/Message.ascx" %>

<div>
    <asp:UpdatePanel ID="CourseDetailUpdatePanel" runat="server" UpdateMode="Conditional">
    <ContentTemplate>

    <div style="width: 1030px">
        <uc:Message ID="ucMessage" runat="server" />
    </div>

    <table class="form-border-xlarge">
        <tr>
            <td>Course:</td>
            <td colspan="2">
                <asp:TextBox ID="txtCourse" runat="server" TabIndex="1" ReadOnly="true"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>Course code:</td>
            <td>
                <asp:TextBox ID="txtCourseCode" runat="server" TabIndex="2" ReadOnly="true"></asp:TextBox>
            </td>
            <td>Accreditation:</td>
            <td >
                <asp:TextBox ID="txtAccreditation" runat="server" TabIndex="3" ReadOnly="true"></asp:TextBox>
            </td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td>Category:</td>
            <td>
                <asp:TextBox ID="txtCategory" runat="server" TabIndex="4" ReadOnly="true"></asp:TextBox>
            </td>
            <td>Certificate:</td>
            <td>
                <asp:TextBox ID="txtCertificate" runat="server" TabIndex="5" ReadOnly="true"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td colspan="5"><hr /></td>
        </tr>
        <tr>
            <td>Date Created:</td>
            <td>
                <asp:TextBox ID="txtDateCreated" runat="server" TabIndex="6" ReadOnly="true"></asp:TextBox>
            </td>
            <td>User Created:</td>
            <td>
                <asp:TextBox ID="txtUserCreated" runat="server" TabIndex="7" ReadOnly="true"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>Date Modified:</td>
            <td>
                <asp:TextBox ID="txtDateModified" runat="server" TabIndex="8" ReadOnly="true"></asp:TextBox>
            </td>
            <td>User Modified:</td>
            <td>
                <asp:TextBox ID="txtUserModified" runat="server" TabIndex="9" ReadOnly="true"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td colspan="5"><hr /></td>
        </tr>
        <tr>
            <td colspan="5">
                <p>
                    Subjects:
                </p>
                <div>
                    <asp:Button ID="btnAdd" runat="server" Text="Add" 
                        CssClass="button" onclick="btnAdd_Click" />
                    <asp:Button ID="btnDelete" runat="server" Text="Remove" 
                        CssClass="button" onclick="btnDelete_Click"/>
                </div>
                <br />

                <asp:GridView ID="SubjectGridView" runat="server" CssClass="table-grid" AlternatingRowStyle-CssClass="odd" FooterStyle-CssClass="table-grid-footer"
                    EmptyDataRowStyle-CssClass="empty" EmptyDataText="No subjects found." PagerStyle-CssClass="pager"
                    DataKeyNames="SubjectCode, EmployeeCode"
                    AutoGenerateColumns="False" 
                    onrowcommand="SubjectGridView_OnRowCommand"
                    onpageindexchanging="SubjectGridView_PageIndexChanging"
                    OnRowEditing="SubjectGridView_RowEditing" 
                    OnRowCancelingEdit="SubjectGridView_RowCancelingEdit"
                    onrowupdating="SubjectGridView_RowUpdating" 
                    AllowPaging="True" PageSize="4">
                    <PagerSettings Mode="NumericFirstLast" Position="Bottom"/>
                    <Columns>
                        <asp:TemplateField HeaderText="Select" HeaderStyle-Width="35px" 
                            HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:CheckBox ID="chkSelect" runat="server" CausesValidation="False"> </asp:CheckBox>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:CheckBox ID="chkSelect" runat="server" Enabled="false" CausesValidation="False"> </asp:CheckBox>
                            </EditItemTemplate>
                            <FooterTemplate>
                                <strong>Add</strong>
                            </FooterTemplate>
                        </asp:TemplateField>

                         <asp:TemplateField HeaderText="Options" HeaderStyle-Width="80px" HeaderStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lnkLectureEdit" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:LinkButton ID="lnkLectureCancel" runat="server" CausesValidation="False"  CommandName="Cancel" Text="Cancel"></asp:LinkButton>
                                    &nbsp;
                                    <asp:LinkButton ID="lnkLectureUpdate" runat="server" CausesValidation="True" CommandName="Update" Text="Update"
                                        ValidationGroup="LectureUpdateValidationGroup"></asp:LinkButton>
                                </EditItemTemplate>
                                <FooterTemplate>
                                    <asp:LinkButton ID="btnLectureCancel" runat="server" Text="Cancel" CausesValidation="false" UseSubmitBehavior="false" CommandName="CancelInsert" />
                                    &nbsp;
                                    <asp:LinkButton ID="btnLectureInsert" runat="server" Text="Save" UseSubmitBehavior="false" CommandName="Insert"
                                        ValidationGroup="LectureSaveValidationGroup" />
                                </FooterTemplate>
                            </asp:TemplateField>

                        <asp:TemplateField HeaderText="Subject Code" HeaderStyle-Width="70px">
                            <ItemTemplate><%# Eval("SubjectCode")%></ItemTemplate>
                            <EditItemTemplate>
                                <asp:Label ID="lblSubjectCode" Text='<%# Eval("SubjectCode")%>' runat="server"></asp:Label>
                            </EditItemTemplate>
                            <FooterTemplate>
                                
                            </FooterTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Type" HeaderStyle-Width="60px">
                            <ItemTemplate><%# Eval("Type")%></ItemTemplate>
                            <EditItemTemplate>
                                <%# Eval("Type")%>
                            </EditItemTemplate>
                            <FooterTemplate>
                                <span style="font-size:smaller">Select subject:</span>
                            </FooterTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Title" HeaderStyle-Width="80px">
                            <ItemTemplate><%# Eval("Title")%></ItemTemplate>
                            <EditItemTemplate>
                                <%# Eval("Title")%>
                            </EditItemTemplate>
                            <FooterTemplate>
                                <asp:DropDownList ID="ddlSubjectTitle" runat="server" />
                            </FooterTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="NQF" HeaderStyle-Width="35px">
                            <ItemTemplate><%# Eval("NQFLevel")%></ItemTemplate>
                            <EditItemTemplate>
                                <%# Eval("NQFLevel")%>
                            </EditItemTemplate>
                            <FooterTemplate>
                                
                            </FooterTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Credits" HeaderStyle-Width="35px">
                            <ItemTemplate><%# Eval("Credits")%></ItemTemplate>
                            <EditItemTemplate>
                                <span style="font-size:smaller">Select trainer:</span>
                            </EditItemTemplate>
                            <FooterTemplate>
                                <span style="font-size:smaller">Select trainer:</span>
                            </FooterTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Employee Code" HeaderStyle-Width="120px">
                            <ItemTemplate><%# Eval("EmployeeCode")%></ItemTemplate>
                            <EditItemTemplate>
                                <asp:DropDownList ID="ddlEmployeeTitle" runat="server" />
                            </EditItemTemplate>
                            <FooterTemplate>
                                <asp:DropDownList ID="ddlEmployeeTitle" runat="server" />
                            </FooterTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <PagerStyle HorizontalAlign="Right" Wrap="False" />
                </asp:GridView>
            </td>
        </tr>
    </table>

    </ContentTemplate>
    </asp:UpdatePanel>
</div>